package com.zs.toolbox.web2j.system.core.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author shuai.zhang  on 2018/9/22
 * @description
 */
@ApiModel("发送注册验证码")
@Data
public class WtSendVCodeReqeust {

    @ApiModelProperty(value = "要发送的目标手机号", example = "15652750943")
    @Pattern(regexp = "([0-9]{11})|(^$)", message = "手机号格式不合法")
    String phone;

    @ApiModelProperty(value = "要发送的目标邮箱", required = false, example = "3163504123@163.com")
    @Email(message = "邮箱格式不合法")
    String email;

    @NotBlank(message = "图像验证码不能为空")
    @ApiModelProperty(value = "校验的图像验证码", required = true)
    String imageCode;

    @ApiModelProperty(value = "是否需要图像验证码", required = true)
    Boolean needCheckImageCode = true;

    @ApiModelProperty(value = "验证码类型:1:注册 2:登陆 3:找回密码", allowableValues = "range[1,3]", required = true, example = "1")
    @Range(min = 1, max = 3, message = "验证码方式不合法")
    @NotNull
    Integer vcodeType = 1;

}
